package com.fengmi.mapper;

import com.fengmi.entity.MallGoodsCat;
import com.fengmi.entity.ViewCatTemplate;
import com.fengmi.vo.CatCascadeVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 作者：陈学虎
 * 时间：2021/7/10 0010 下午 2:28
 */
@Mapper
public interface CatTemplateMapper {

    @Select("select * from view_cat_template where parent_id = #{pid} ")
    List<ViewCatTemplate> findByParen(Long pid);

    @Insert("insert into mall_goods_cat (parent_id,name,template_id) values (#{parentId} ,#{name} ,#{templateId} )")
    int addCat(MallGoodsCat mallGoodsCat);

    List<CatCascadeVo> findCatCascade();
}
